delimiter $$

CREATE TABLE `profiles` (
  `profId` bigint(20) NOT NULL AUTO_INCREMENT,
  `userId` bigint(20) NOT NULL,
  `parentProfId` bigint(20) DEFAULT NULL,
  `firstName` varchar(45) DEFAULT NULL,
  `lastName` varchar(45) DEFAULT NULL,
  `address` text,
  `birthDate` timestamp NULL DEFAULT NULL,
  `gender` varchar(10) DEFAULT NULL,
  `isDeath` varchar(10) DEFAULT NULL,
  `deathDt` timestamp NULL DEFAULT NULL,
  `socialStatus` varchar(10) DEFAULT NULL,
  `acadimicQual` varchar(10) DEFAULT NULL,
  `ceatedDT` timestamp NULL DEFAULT NULL,
  `lastUpdatedDT` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `country` varchar(45) DEFAULT NULL,
  `city` varchar(45) DEFAULT NULL,
  `blodType` varchar(10) DEFAULT NULL,
  `religion` varchar(10) DEFAULT NULL,
  `image` blob,
  `imageType` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`profId`),
  KEY `FK_Users_Profiles` (`userId`),
  KEY `FK_Profiles_Profiles` (`parentProfId`),
  CONSTRAINT `FK_Profiles_Profiles` FOREIGN KEY (`parentProfId`) REFERENCES `profiles` (`profId`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_Users_Profilies` FOREIGN KEY (`userId`) REFERENCES `users` (`userId`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8$$

